package com.hfy.user.mapper;

import com.hfy.model.po.user.UserPo;
import org.apache.ibatis.annotations.*;

/**
 * @ author 韩
 * time: 2024/5/12 21:33
 */

@Mapper
public interface RegisterMapper {

    // 查询该账号是否存在
    @Select("select * from user where account=#{account}")
    UserPo selectByAccount(@Param("account") Long account);

    @Insert("insert into user(account,username,password,avatar) values(#{account},#{username},#{password},#{avatar})")
    void register(@Param("avatar") String avatar,@Param("account") Long account, @Param("username") String username, @Param("password") String password);

    @Delete("DELETE * FROM `user` where account = #{account}")
    boolean rollbackRecord(Long account);
}
